<?php

namespace App\Http\Validate\Kms\Common;

use App\Http\Validate\AbstractBaseValidate;
use Illuminate\Support\MessageBag;
use Illuminate\Validation\ValidationException;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;

class ConfigValidate extends AbstractBaseValidate
{
    function getRules(): array
    {
        // TODO: Implement getRules() method.
        return [];
    }

    function getAttributes(): array
    {
        // TODO: Implement getAttributes() method.
        return [];
    }

    function registerValidateRules(): void
    {
        // TODO: Implement registerValidateRules() method.
    }

    function getMessages(): array
    {
        // TODO: Implement getMessages() method.
        return [];
    }

    /**
     * @param array $params
     * @return MessageBag|object
     * @throws ValidationException
     * @throws ContainerExceptionInterface
     * @throws NotFoundExceptionInterface
     */
    public static function noLoginValidate(array $params)
    {
        return self::getInstance()->validate(["version"], $params, [
            "version" => [
                "required",
                "string",
                "regex:/^[1-9][\d]*+[\.\d+]{1,10}$/"
            ]
        ]);
    }
}
